﻿CREATE TABLE [dbo].[DimAlbum](
	[AlbumId] [int] identity(1,1),
	[AlbumCode] [int] NOT NULL,
	[Title] [nvarchar](160) NOT NULL,
	[ArtistId] [int] NOT NULL DEFAULT -1,
 [TaskExecutionLogId] INT NOT NULL DEFAULT 0, 
    CONSTRAINT [PK_DimAlbum] PRIMARY KEY CLUSTERED 
(
	[AlbumId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[DimAlbum]  WITH CHECK ADD  CONSTRAINT [FK_DimAlbum_DimArtistId] FOREIGN KEY([ArtistId])
REFERENCES [dbo].[DimArtist] ([ArtistId])
GO

ALTER TABLE [dbo].[DimAlbum] CHECK CONSTRAINT [FK_DimAlbum_DimArtistId]
GO
